﻿using CloudTest.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;

namespace CloudTest.Controllers
{
    public class ValuesController : ApiController
    {
        // GET api/values
        public IEnumerable<Person> Get()
        {
            List<Person> people = new List<Person>();

            people.Add(new Person { Name = "Jon", Age = 42, Registered = new DateTime(2008, 3, 24)});
            people.Add(new Person { Name = "Ann", Age = 27, Registered = new DateTime(2009, 7, 24)});
            people.Add(new Person { Name = "Paavo", Age = 28, Registered = new DateTime(2010, 7, 24) });

            return people;
        }

        // GET api/values/5
        public string Get(int id)
        {
            string exim = System.Configuration.ConfigurationManager.AppSettings["EXIM"];
            //string exim = "EX";

            return String.Format("FZR 2000 -# {0} -# {1}", id, exim);
        }

        // POST api/values
        public void Post([FromBody]string value)
        {
        }

        // PUT api/values/5
        public void Put(int id, [FromBody]string value)
        {
        }

        // DELETE api/values/5
        public void Delete(int id)
        {
        }
    }
}